<div id="buscar">
    <%= form_tag({:action=> "index"}, :method => 'get' ) %>
    <span style="FLOAT: left"><h1><input id="t" class="texto" onclick="javascript:restart('t')" type="text" value='<%= params[:search]%>' name="search"></h1></span><input type="image" img src="/images/search.png" border="0px" align="right" style="padding-right:10px";  alt="Buscar Caballos" title="Buscar Caballo">
    </form>
</div>
<div class="post">
    <h2>Caballos</h2>
    <br/>
    <% if @horses.empty? %>
    No se encontro <%= @search %>
    <% else %>
    <table border="3" cellpadding='0' cellspacing='0' bordercolor='#d1ccc7'>
        <tr>
            <th align='center'>
                Nombre del caballo
            </th>
            <th align='center'>
                Sexo
            </th>
            <th align='center'>
                Año de nacimiento
            </th>
            <th align='center'>
                Opciones
            </th>
        </tr>
        <% @horses.each do |horse| %>
        <tr onmouseover="this.style.background='#BEE696'",  onmouseout="this.style.background='white'" bgcolor="white">
            <td width='250px' height="32px" align='center'>
                <%=h horse.horse_name %>
            </td>
            <td width='150px' height="32px" align='center'>
                <%=h Horsesexe.find(horse.horse_sex_id).sex_name %>
            </td>
            <td width='200px' height="32px" align='center'>
                <% if horse.born==nil %>
                No hay datos<% else %>
                <%=h horse.born %>
                <% end %>
            </td>
            <td width='150px' height="32px" align='center'>
                <%= link_to '<img src="/images/profile.png" border="0px" align="left" style="padding-right:10px"; alt="Ver Perfiel" title="Ver Perfiel">', horse,:class=>'opacityit' %>
                <%= link_to '<img src="/images/edit.png" border="0px" align="left" style="padding-right:10px" alt="Editar" title="Editar Perfiel">', edit_horse_path(horse),:class=>'opacityit' %>
            </td>
        </tr>
        <%end %>
    </table>
    <% end %>
    <%= will_paginate @horses %>
</div>
</div>
<div id="sidebar">
    <ul>
        <li>
            <h2>Herramientas</h2>
            <ul>
                <li>
                    <%= link_to 'Insertar Caballo', new_pendinghorse_path %>
                </li>
                <li>
                    <%= link_to 'Ver Familias', families_path %>
                </li>
                <li>
                    <%= link_to 'Ver Jefes de Razas', breedheads_path %>
                </li>
            </ul>
        </li>
    </ul>
</div>
